package com.firefly.dao.assembler.ums;

import com.firefly.dao.dao.ums.po.AdminPo;
import com.firefly.dao.vo.ums.RoleAdminVo;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.ArrayList;

/**
 * @description: 角色下用户数据类型转换
 * @author: lzg(萤火科技 ： 854378082 @ qq.com)
 * @date: 2022/12/5
 **/
@Component
public class RoleAdminAssembler {
    public List<RoleAdminVo> getListVo(List<AdminPo> list){
        List<RoleAdminVo> result = new ArrayList<>();
        list.forEach(item -> {
            RoleAdminVo tmp = new RoleAdminVo();
            tmp.setId(item.getId());
            tmp.setName(item.getName());
            tmp.setRealname(item.getRealname());
            tmp.setPhone(item.getPhone());
            tmp.setEmail(item.getEmail());
            result.add(tmp);
        });
        return result;
    }
}
